how to know when a person with dementia is nearing the end of life